import React from 'react';

import './index.css';
import LayoutView, { LayoutMode } from '../layout';
import Advice from './Advice';
import Detail from './Detail';
import Simulation from './Simulation';
import ReportTab from '../report-tab/ReportTab';

/**
 * 結果詳細：5つの健康習慣
 */
const ReportFiveHealthHabit = ({ inputData, risk, initialRisk, advice, fiveHealtHabitFlgs, onCalcRisk, onCancel, defaultSection }) => (
  <LayoutView
    mode={LayoutMode.DETAIL}
    title="健康習慣によるがんリスク"
    handleBack={onCancel}
    riskLevel={initialRisk.probability.riskLevel}
    className="ReportFiveHealthHabit"
  >
    <ReportTab
      category="5つの健康習慣"
      defaultSection={defaultSection}
      detailRender={() => (
        <Detail {...initialRisk} />
      )}
      adviceRender={() => (
        <Advice
          message={advice.message}
          {...initialRisk.diagnosis}
        />
      )}
      simulationRender={() => (
        <Simulation
          inputData={inputData}
          fiveHealtHabitFlgs={fiveHealtHabitFlgs}
          risk={risk}
          initialRisk={initialRisk}
          onCalcRisk={onCalcRisk}
        />
      )}
    />
  </LayoutView>
)
/*
ReportFiveHealthHabit.propTypes = {
  inputData: React.PropTypes.object.isRequired,
  fiveHealtHabitFlgs: React.PropTypes.shape({
    okSmoking: React.PropTypes.bool.isRequired,
    okAlcohol: React.PropTypes.bool.isRequired,
    okBmi: React.PropTypes.bool.isRequired,
    okActivity: React.PropTypes.bool.isRequired,
    okSalineFood: React.PropTypes.bool.isRequired,
    count: React.PropTypes.number.isRequired,
  }),
  risk: React.PropTypes.shape({
    probability: React.PropTypes.shape({
      you: React.PropTypes.number.isRequired,
      min: React.PropTypes.number.isRequired,
      max: React.PropTypes.number.isRequired,
    }),
  }),
  initialRisk: React.PropTypes.shape({
    probability: React.PropTypes.shape({
      you: React.PropTypes.number.isRequired,
      min: React.PropTypes.number.isRequired,
      max: React.PropTypes.number.isRequired,
    }),
  }),
  advice: React.PropTypes.shape({
    message: React.PropTypes.string,
  }),
  onCalcRisk: React.PropTypes.func,
  onCancel: React.PropTypes.func,
  defaultSection: React.PropTypes.string,
};*/

export default ReportFiveHealthHabit
